diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php
index 04c5747..1eb8348 100644
--- a/system/helpers/file_helper.php
+++ b/system/helpers/file_helper.php
@@ -40,7 +40,7 @@
 {
 	function read_file($file)
 	{
-		if ( ! file_exists($file))
+		if (! file_exists($file))
 		{
 			return FALSE;
 		}
@@ -50,7 +50,7 @@
 			return file_get_contents($file);		
 		}
 
-		if ( ! $fp = @fopen($file, 'rb'))
+		if (! $fp = @fopen($file, 'rb'))
 		{
 			return FALSE;
 		}
@@ -87,7 +87,7 @@
 {
 	function write_file($path, $data, $mode = 'wb')
 	{
-		if ( ! $fp = @fopen($path, $mode))
+		if (! $fp = @fopen($path, $mode))
 		{
 			return FALSE;
 		}
@@ -123,7 +123,7 @@
 		// Trim the trailing slash
 		$path = preg_replace("|^(.+?)/*$|", "\\1", $path);
 		
-		if ( ! $current_dir = @opendir($path))
+		if (! $current_dir = @opendir($path))
 			return;
 	
 		while(FALSE !== ($filename = @readdir($current_dir)))
@@ -167,7 +167,7 @@
 {
 	function get_filenames($source_dir, $include_path = FALSE, $_recursion = FALSE)
 	{
-		static $_filedata = array();
+		$_filedata = array();
 				
 		if ($fp = @opendir($source_dir))
 		{
@@ -180,11 +180,11 @@
 			
 			while (FALSE !== ($file = readdir($fp)))
 			{
-				if (@is_dir($source_dir.$file) && substr($file, 0, 1) != '.')
+				if (@is_dir($source_dir.$file) && strncmp($file, '.', 1) !== 0)
 				{
 					 get_filenames($source_dir.$file.DIRECTORY_SEPARATOR, $include_path, TRUE);
 				}
-				elseif (substr($file, 0, 1) != ".")
+				elseif (strncmp($file, '.', 1) !== 0)
 				{
 			
 					$_filedata[] = ($include_path == TRUE) ? $source_dir.$file : $file;
@@ -201,4 +201,171 @@
 
 // --------------------------------------------------------------------
 
+/**
+ * Get Directory File Information
+ *
+ * Reads the specified directory and builds an array containing the filenames,  
+ * filesize, dates, and permissions
+ *
+ * Any sub-folders contained within the specified path are read as well.
+ *
+ * @access	public
+ * @param	string	path to source
+ * @param	bool	whether to include the path as part of the filename
+ * @param	bool	internal variable to determine recursion status - do not use in calls
+ * @return	array
+ */	
+if (! function_exists('get_dir_file_info'))
+{
+	function get_dir_file_info($source_dir, $include_path = FALSE, $_recursion = FALSE)
+	{
+		$_filedata = array();
+		$relative_path = $source_dir;
+				
+		if ($fp = @opendir($source_dir))
+		{
+			// reset the array and make sure $source_dir has a trailing slash on the initial call
+			if ($_recursion === FALSE)
+			{
+				$_filedata = array();
+				$source_dir = rtrim(realpath($source_dir), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
+			}
+
+			while (FALSE !== ($file = readdir($fp)))
+			{
+				if (@is_dir($source_dir.$file) && strncmp($file, '.', 1) !== 0)
+				{
+					 get_dir_file_info($source_dir.$file.DIRECTORY_SEPARATOR, $include_path, TRUE);
+				}
+				elseif (strncmp($file, '.', 1) !== 0)
+				{
+					$_filedata[$file] = get_file_info($source_dir.$file);
+					$_filedata[$file]['relative_path'] = $relative_path;
+				}
+			}
+			return $_filedata;
+		}
+		else
+		{
+			return FALSE;
+		}
+	}
+}
+
+// --------------------------------------------------------------------
+
+/**
+* Get File Info
+*
+* Given a file and path, returns the name, path, size, date modified
+* Second parameter allows you to explicitly declare what information you want returned
+* Options are: name, server_path, size, date, readable, writable, executable, fileperms
+* Returns FALSE if the file cannot be found.
+*
+* @access    public
+* @param    string    path to file
+* @param    mixed    array or comma separated string of information returned
+* @return    array
+*/    
+if (! function_exists('get_file_info'))
+{
+    function get_file_info($file, $returned_values = array('name', 'server_path', 'size', 'date'))
+    {
+
+        if (! file_exists($file))
+        {
+            return FALSE;
+        }
+
+        if (is_string($returned_values))
+        {
+            $returned_values = explode(',', $returned_values);
+        }
+
+        foreach ($returned_values as $key)
+        {
+            switch ($key)
+            {
+                case 'name':
+                    $fileinfo['name'] = substr(strrchr($file, '/'), 1);
+                    break;
+                case 'server_path':
+                    $fileinfo['server_path'] = $file;
+                    break;
+                case 'size':
+                    $fileinfo['size'] = filesize($file);
+                    break;
+                case 'date':
+                    $fileinfo['date'] = filectime($file);
+                    break;
+                case 'readable':
+                    $fileinfo['readable'] = is_readable($file);
+                    break;
+                case 'writable':
+                    // There are known problems using is_weritable on IIS.  It may not be reliable - consider fileperms()
+                    $fileinfo['writable'] = is_writable($file);
+                    break;
+                case 'executable':
+                    $fileinfo['executable'] = is_executable($file);
+                    break;
+                case 'fileperms':
+                    $fileinfo['fileperms'] = fileperms($file);
+                    break;
+            }
+        }
+
+        return $fileinfo;
+    }
+}
+
+// --------------------------------------------------------------------
+
+/**
+ * Get Mime by Extension
+ *
+ * Translates a file extension into a mime type based on config/mimes.php. 
+ * Returns FALSE if it can't determine the type, or open the mime config file
+ *
+ * Note: this is NOT an accurate way of determining file mime types, and is here strictly as a convenience
+ * It should NOT be trusted, and should certainly NOT be used for security
+ *
+ * @access	public
+ * @param	string	path to file
+ * @return	mixed
+ */	
+if (! function_exists('get_mime_by_extension'))
+{
+	function get_mime_by_extension($file)
+	{
+		$extension = substr(strrchr($file, '.'), 1);
+	
+		global $mimes;
+	
+		if (! is_array($mimes))
+		{
+			if (! require_once(APPPATH.'config/mimes.php'))
+			{
+				return FALSE;
+			}
+		}
+
+		if (array_key_exists($extension, $mimes))
+		{
+			if (is_array($mimes[$extension]))
+			{
+				// Multiple mime types, just give the first one
+				return current($mimes[$extension]);
+			}
+			else
+			{
+				return $mimes[$extension];
+			}
+		}
+		else
+		{
+			return FALSE;
+		}
+	}
+}
+
 ?>
\ No newline at end of file
